#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QUrl>
#include <QAudioOutput>
#include <QMediaPlayer>
#include <QPushButton>
#include <QSlider>
#include <QMouseEvent>
#include <QLabel>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public slots:
    void onVolumeChanged(int value); // 声明槽函数

private slots:
    void on_pushButton_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_5_clicked();

    void on_listWidget_doubleClicked(const QModelIndex &index);

    void on_pushButton_6_clicked();

private:
    Ui::MainWindow *ui;
    QSlider *volumeSlider;
    bool isVolumeSliderVisible; // 用于跟踪滑块是否可见
    QList<QUrl> playList; //播放列表
    QAudioOutput* out;
    int curPlayIndex;
    QMediaPlayer* mediaPlayer;
    QIcon playIcon, pauseIcon;
    QPushButton *playPauseButton;
    QLabel *volumeLabel;
protected:
    void mousePressEvent(QMouseEvent *event) override;

};
#endif // MAINWINDOW_H
